def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)

if __name__ == "__main__":

    n = input("输入所求Fibonacci数下标:")
    while not(n.isdigit()):
        n = input("输入错误，请输入非负整数:")

    n = int(n)
    print("第{}个Fibonacci数为:".format(n), fibonacci(n))
